//
//  SSSTodayBenefitViewCell.m
//  SSSMerchant
//
//  Created by xnxin on 2017/3/22.
//  Copyright © 2017年 xnxin. All rights reserved.
//

#import "SSSMerchantTodayBenefitViewCell.h"
#import "SSSMerchantTodayBenefitViewCellModel.h"
#import "NSDateAddition.h"
#import "NSNumber+Addition.h"


@interface SSSMerchantTodayBenefitViewCell()

@property (nonatomic, strong, readonly) SSSMerchantTodayBenefitViewCellModel *model;
@end

@implementation SSSMerchantTodayBenefitViewCell
@dynamic model;

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code

    self.percentLabel.layer.cornerRadius = 5;
    self.percentLabel.layer.masksToBounds = true;

    self.graylineEdgeInset = UIEdgeInsetsMake(0, 15, 0, 15);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(SSSMerchantTodayBenefitViewCellModel*)model {
    _model = model;

    self.dateLabel.text = [model.date xhstringWithFormat:@"yyyy-MM-dd HH:mm"];
    self.phoneNumberLabel.text = model.phone;
    self.percentLabel.text = model.discountDisplayValue;
    self.benefitSourceTypeLabel.text = model.orderSourceDisplayValue;
    self.moneyLabel.text = model.money.moneyValue;
}

@end
